﻿using System.Collections.Generic;
using System.Drawing;

namespace Ants.SimpleDistributionProblem.DTO
{
    /// <summary>
    /// Class representing the data to analyze.
    /// </summary>
    public class Data
    {
        /// <summary>
        /// Gets or sets the cities.
        /// </summary>
        /// <value>
        /// The cities.
        /// </value>
        public List<Point> Cities { get; set; }

        /// <summary>
        /// Gets or sets the K.
        /// </summary>
        /// <value>
        /// The K.
        /// </value>
        public int K { get; set; }

        /// <summary>
        /// Gets the size which all cities can fit.
        /// </summary>
        /// <value>
        /// The size.
        /// </value>
        public Size Size
        {
            get
            {
                int maxX = Cities[0].X;
                int maxY = Cities[0].Y;

                foreach (Point city in Cities)
                {
                    if (city.X > maxX)
                    {
                        maxX = city.X;
                    }

                    if (city.Y > maxY)
                    {
                        maxY = city.Y;
                    }
                }

                return new Size(maxX, maxY);
            }
        }
    }
}